fix: default push title to article H1 instead of filename slug - #17
Merged
Conversation
Without --title, both relay push paths fell back to the input filename slug, producing WeChat drafts literally titled 'publish' (2026-07-18 production incident, waste draft cleaned up via draft/delete API). Add extractH1FromMarkdown/extractH1FromFile and a single pushTitle chain (--title > H1 > slug) used by both the automatic relay branch and the manual relay command builder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed
scripts/orchestrator.mjs: 新增extractH1FromMarkdown/extractH1FromFile;主流程新增pushTitle = --title || H1 || slug,自动 relay 分支(remoteTitle)与 manual relay 命令构建(buildManualRelayCommand 调用点)统一使用。CHANGELOG.md:[Unreleased] → Fixed 记录本修复。事故背景
2026-07-18 星流涌动 7 篇系列推送时,未传
--title的首推产出标题为「publish」的废草稿(manualTitle = args.title || slug,slug 取自 publish.md 文件名)。废草稿已用微信 draft/delete API 清理,后续 6 篇均显式传 --title 绕过。Verification
node --check通过npm run check全套 9 项 harness 契约测试通过--title 'Token 工厂时代:英伟达的全栈与中国拼图',不再退化为 publishResidual risk
title || slug兜底(防御性),当前调用点已恒传 pushTitle。Claim level
repo-verified: 本地测试与干跑验证;生产事故来自 2026-07-18 真实推送回执。